<?php

namespace App\Models\log;

use App\Models\Model;

/**
 * App\Models\log\ErrorLog
 *
 * @property int $id
 * @property string $msg 报错信息
 * @property string $params
 * @property string $content 异常内容
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereMsg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereParams($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\log\ErrorLog whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read mixed $header_img
 * @property-read mixed $icon
 * @property-read mixed $img
 * @property-read mixed $imgs
 */
class ErrorLog extends Model
{

    protected $fillable = [
        'msg',
        'params',
        'content'
    ];


    public function setParamsAttribute($value)
    {
        $this->attributes['params'] = json_encode($value);
    }



    public function getParamsAttribute($value)
    {
        return json_decode($value,true);
    }


}
